package org.bbelovic.devel.exercises.sequences.impl;

import java.util.ArrayList;
import java.util.List;

import org.bbelovic.devel.exercises.sequences.SequenceGenerator;

public class FactorialSequenceGenerator implements SequenceGenerator {

    public List<Integer> generateSequence(final int n) {
        final List<Integer> result = new ArrayList<Integer>();
        int act = 1;
        for (int i = act; i <= n; i++ ) {
            act = act * i;
            result.add(act);
        }
        return result;
    }

}
